home *** CD-ROM | disk | FTP | other *** search
- /***************************************************************************************
-
- File: AppleGuide.h
-
- Contains: Public interface to Apple Guide.
-
- Written by: Dave Lyons and John R. Powers, III
-
- Copyright: ©1994 by Apple Computer, Inc., all rights reserved.
-
- Change History (most recent first):
-
- <8> 04/04/94 JRP Beta seed
-
- ***************************************************************************************/
-
- #ifndef __APPLEGUIDE__
- #define __APPLEGUIDE__
-
- #ifndef __APPLEEVENTS__
- #include <AppleEvents.h>
- #endif
-
- #ifndef __FILES__
- #include <Files.h>
- #endif
-
- #ifndef __TYPES__
- #include <Types.h>
- #endif
-
-
- // Types
-
- typedef unsigned long UInt32;
- typedef unsigned short UInt16;
- typedef signed short SInt16;
-
- typedef UInt32 AGRefNum;
- typedef UInt32 AGCoachRefNum;
- typedef UInt32 AGContextRefNum;
-
-
- typedef struct AGAppInfo
- {
- AEEventID eventId;
- long refCon;
- void* contextObj; // private system field
- }
- AGAppInfo, *AGAppInfoPtr, **AGAppInfoHdl;
-
- typedef pascal OSErr (*CoachReplyProcPtr)(Rect* pRect,
- Ptr name,
- long refCon);
-
-
- typedef pascal OSErr (*ContextReplyProcPtr)(Ptr pInputData,
- Size inputDataSize,
- Ptr *ppOutputData,
- Size *pOutputDataSize,
- AGAppInfoHdl hAppInfo);
-
- // Constants
-
- #define gestaltAppleGuidePresent 31
- #define kAGDefault 0
- #define kAGFrontDatabase 1
- #define kAGNoMixin (-1)
-
-
- enum
- {
- kAGViewFullHowdy = 1, // Full-size Howdy
- kAGViewTopicAreas = 2, // Full-size Topic Areas
- kAGViewIndex = 3, // Full-size Index Terms
- kAGViewLookFor = 4, // Full-size Look-For (Search)
- kAGViewSingleHowdy = 5, // Single-list-size Howdy
- kAGViewSingleTopics = 6 // Single-list-size Topics
- };
-
-
- enum
- {
- kAGFileMain = 'help',
- kAGFileMixin = 'mixn'
- };
-
-
- enum AGDBTypeBit // To test against AGGetAvailableDBTypes
- {
- kAGDBTypeBitAny = 0x00000001,
- kAGDBTypeBitHelp = 0x00000002,
- kAGDBTypeBitTutorial = 0x00000004,
- kAGDBTypeBitShortcuts = 0x00000008,
- kAGDBTypeBitAbout = 0x00000010,
- kAGDBTypeBitOther = 0x00000080
- };
-
-
- typedef UInt16 AGStatus;
- enum // Returned by AGGetStatus
- {
- kAGIsNotRunning,
- kAGIsSleeping,
- kAGIsActive
- };
-
-
- typedef UInt16 AGWindowKind;
- enum // Returned by AGGetFrontWindowKind
- {
- kAGNoWindow,
- kAGAccessWindow,
- kAGPresentationWindow
- };
-
- // Error Codes
-
- typedef SInt16 AGErr; // Not an enum, because other OSErrs are valid.
- enum // Apple Guide error codes
- {
- // -------------------- Apple event reply codes
-
- kAGErrUnknownEvent = -2900,
- kAGErrCantStartup = -2901,
- kAGErrNoAccWin = -2902,
- kAGErrNoPreWin = -2903,
- kAGErrNoSequence = -2904,
- kAGErrNotOopsSequence = -2905,
- kAGErrReserved06 = -2906,
- kAGErrNoPanel = -2907,
- kAGErrContentNotFound = -2908,
- kAGErrMissingString = -2909,
- kAGErrInfoNotAvail = -2910,
- kAGErrEventNotAvailable = -2911,
- kAGErrCannotMakeCoach = -2912,
- kAGErrSessionIDsNotMatch = -2913,
- kAGErrMissingDatabaseSpec = -2914,
-
- // -------------------- Coach's Chalkboard reply codes
-
- kAGErrItemNotFound = -2925,
- kAGErrBalloonResourceNotFound = -2926,
- kAGErrChalkResourceNotFound = -2927,
- kAGErrChdvResourceNotFound = -2928,
- kAGErrAlreadyShowing = -2929,
- kAGErrBalloonResourceSkip = -2930,
- kAGErrItemNotVisible = -2931,
- kAGErrReserved32 = -2932,
- kAGErrNotFrontProcess = -2933,
- kAGErrMacroResourceNotFound = -2934,
-
- // -------------------- API reply codes
-
- kAGErrAppleGuideNotAvailable = -2951,
- kAGErrCannotInitCoach = -2952,
- kAGErrCannotInitContext = -2953,
- kAGErrCannotOpenAliasFile = -2954,
- kAGErrNoAliasResource = -2955,
- kAGErrDatabaseNotAvailable = -2956,
- kAGErrDatabaseNotOpen = -2957,
- kAGErrMissingAppInfoHdl = -2958,
- kAGErrMissingContextObject = -2959,
- kAGErrInvalidRefNum = -2960,
- kAGErrDatabaseOpen = -2961,
- kAGErrInsufficientMemory = -2962
-
- };
-
- // Events
-
- typedef UInt32 AGEvent; // Not an enum because we want to make assignments.
- enum // Handy events for AGGeneral.
- {
- // Panel actions (Require a presentation window).
- kAGEventDoCoach = 'doco',
- kAGEventDoHuh = 'dhuh',
- kAGEventGoNext = 'gonp',
- kAGEventGoPrev = 'gopp',
- kAGEventHidePanel = 'pahi',
- kAGEventReturnBack = 'gobk',
- kAGEventShowPanel = 'pash',
- kAGEventTogglePanel = 'patg'
- };
-
- // Functions
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- // AGClose
- // Close the database associated with the AGRefNum.
-
- pascal AGErr AGClose(AGRefNum *refNum)
- = {0x7011,0xAA6E};
-
- // AGGeneral
- // Cause various events to happen.
-
- pascal AGErr AGGeneral(AGRefNum refNum, AGEvent theEvent)
- = {0x700D,0xAA6E};
-
- // AGGetAvailableDBTypes
- // Return the database types available for this application.
-
- pascal UInt32 AGGetAvailableDBTypes(void)
- = {0x7008,0xAA6E};
-
- // AGGetFrontWindowKind
- // Return the kind of the front window.
-
- pascal AGWindowKind AGGetFrontWindowKind(AGRefNum refNum)
- = {0x700C,0xAA6E};
-
- // AGGetFSSpec
- // Return the FSSpec for the AGRefNum.
-
- pascal AGErr AGGetFSSpec(AGRefNum refNum, FSSpec* fileSpec)
- = {0x700F,0xAA6E};
-
- // AGGetStatus
- // Return the status of Apple Guide.
-
- pascal AGStatus AGGetStatus(void)
- = {0x7009,0xAA6E};
-
- // AGInstallCoachHandler
- // Install a Coach object location query handler.
-
- pascal AGErr AGInstallCoachHandler(CoachReplyProcPtr coachReplyProc, long refCon,
- AGCoachRefNum *resultRefNum)
- = {0x7012,0xAA6E};
-
- // AGInstallContextHandler
- // Install a context check query handler.
-
- pascal AGErr AGInstallContextHandler(ContextReplyProcPtr contextReplyProc,
- AEEventID eventID, long refCon, AGContextRefNum *resultRefNum)
- = {0x7013,0xAA6E};
-
- // AGIsDatabaseOpen
- // Return true if the database associated with the AGRefNum is open.
-
- pascal Boolean AGIsDatabaseOpen(AGRefNum refNum)
- = {0x7006,0xAA6E};
-
- // AGOpen
- // Open a guide database.
-
- pascal AGErr AGOpen(FSSpec *fileSpec, UInt32 flags, Handle mixinControl,
- AGRefNum *resultRefNum)
- = {0x7001,0xAA6E};
-
- // AGOpenWithSearch
- // Open a guide database and preset a search string.
-
- pascal AGErr AGOpenWithSearch(FSSpec *fileSpec, UInt32 flags, Handle mixinControl,
- ConstStr255Param searchString,
- AGRefNum *resultRefNum)
- = {0x7002,0xAA6E};
-
- // AGOpenWithSequence
- // Open a guide database and display a presentation window sequence.
-
- pascal AGErr AGOpenWithSequence(FSSpec *fileSpec, UInt32 flags, Handle mixinControl,
- short sequenceID,
- AGRefNum *resultRefNum)
- = {0x7004,0xAA6E};
-
- // AGOpenWithView
- // Open a guide database and override the default view.
-
- pascal AGErr AGOpenWithView(FSSpec *fileSpec, UInt32 flags, Handle mixinControl,
- short viewNum,
- AGRefNum *resultRefNum)
- = {0x7005,0xAA6E};
-
- // AGQuit
- // Make Apple Guide quit.
-
- pascal AGErr AGQuit(void)
- = {0x7010,0xAA6E};
-
- // AGRemoveCoachHandler
- // Remove the Coach object location query handler.
-
- pascal AGErr AGRemoveCoachHandler(AGCoachRefNum *resultRefNum)
- = {0x7014,0xAA6E};
-
- // AGRemoveContextHandler
- // Remove the context check query handler.
-
- pascal AGErr AGRemoveContextHandler(AGContextRefNum *resultRefNum)
- = {0x7015,0xAA6E};
-
- // AGStart
- // Start up Apple Guide in the background.
-
- pascal AGErr AGStart(void)
- = {0x700A,0xAA6E};
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif // __APPLEGUIDE__
-